<?
//ini_set('display_errors','on');
//error_reporting(E_ALL);

session_start();

//使用客户端的IP来区别吧
function GetIP(){
   if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
       $ip = getenv("HTTP_CLIENT_IP");
   else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown"))
       $ip = getenv("HTTP_X_FORWARDED_FOR");
   else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown"))
       $ip = getenv("REMOTE_ADDR");
   else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown"))
       $ip = $_SERVER['REMOTE_ADDR'];
   else
       $ip = "unknown";
   if(strstr($ip,'.'))
   {
   	$ip =str_replace('.','_',$ip);
   }
   return $ip;
}


if (ini_get('register_globals'))
{
   foreach($GLOBALS as $s_variable_name => $m_variable_value)
   {
       if (!in_array($s_variable_name, array('GLOBALS', 'argv', 'argc', '_FILES', '_COOKIE','_REQUEST' , '_POST', '_GET', '_SERVER', '_ENV', '_SESSION', 's_variable_name', 'm_variable_value')))
       {
		   //echo $s_variable_name.'<br/>';
           unset($GLOBALS[$s_variable_name]);
       }
   }
   unset($GLOBALS['s_variable_name']);
   unset($GLOBALS['m_variable_value']);
}

$cfg['ADMIN_PWD'] = 'tammyf';

$language = $_GET['lang'];
if( !$language ){
	$language = 'default';
}
include_once(dirname(__FILE__)."/lang/{$language}.php");
?>